package com.walle.ak47.commons.jaxrs.exception;

import com.walle.ak47.commons.jaxrs.constant.ServerCode;

/**
 * 自定义业务异常类
 * 
 * @author Bisharp
 */
public class BizException extends RuntimeException {
	private static final long serialVersionUID = 1L;

	private int code;
	
	public BizException() {
		super();
	}

	public BizException(String message) {
		super(message);
		this.code = ServerCode.OTHER_ERROR.code();
	}
	
	public BizException(int code, String message) {
		super(message);
		this.code = code;
	}

	/**
	 * 避免获取方法栈快照信息
	 */
	@Override
	public Throwable fillInStackTrace() {
		return this;
	}
	
	public int getCode() {
		return this.code;
	}
}
